home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 02 Useful Techniques / 08 Zarozinski / src / ffllapi / MemberFuncTri.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  1.8 KB  |  64 lines

  1. //
  2. // File:    MemberFuncTri.h
  3. //
  4. // Purpose:    This class is for the triangle shaped member function
  5. //
  6. // Copyright ⌐ 1999-2001 Louder Than A Bomb! Software
  7. //
  8. // This file is part of the FFLL (Free Fuzzy Logic Library) project (http://ffll.sourceforge.net)
  9. // It is released under the BSD license, see http://ffll.sourceforge.net/license.txt for the full text.
  10. //
  11.  
  12.  
  13. #if !defined(AFX_MEMBERFUNCTRI_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_)
  14. #define AFX_MEMBERFUNCTRI_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_
  15.  
  16.  
  17. #include "MemberFuncBase.h"
  18.  
  19. // 
  20. // Class:    MemberFuncTri
  21. //
  22. // This is the triangle shaped membership function. It consists of 3 points.
  23. // 
  24.  
  25. class FFLL_API MemberFuncTri :  virtual public MemberFuncBase  
  26. {
  27.      ////////////////////////////////////////
  28.     ////////// Member Functions ////////////
  29.     ////////////////////////////////////////
  30.  
  31.     public:
  32.  
  33.         // constructor/destructor funcs
  34.         MemberFuncTri(); // No function body for this. Explicitly disallow auto-creation of it by the compiler
  35.         MemberFuncTri(FuzzySetBase* _parent);
  36.           virtual ~MemberFuncTri();
  37.     
  38.         // set functions
  39.          void set_ramp(int hi_lo_ind, int left_right_ind);
  40.           void set_node(int idx, int x, int y, bool validate = true);
  41.  
  42.         // get functions
  43.          virtual int get_center_x(void) const ;
  44.          virtual int get_func_type() const;
  45.          virtual int get_node_count() const;
  46.  
  47.         // misc functions
  48.         void calc( );
  49.          virtual void expand(int x_delta );
  50.          virtual void shrink(int x_delta );
  51.  
  52.     protected:
  53.  
  54.         // mics functions
  55.         void init_nodes(int start_x, int term_width);
  56.  
  57. }; // end class MemberFuncTri
  58.  
  59. #else
  60.  
  61. class MemberFuncTri; // already defined
  62.  
  63. #endif // !defined(AFX_MEMBERFUNCTRI_H__DE3C07E3_650E_11D3_B77F_906F59C10001__INCLUDED_)
  64.